home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
001-025
/
scopedisk6
/
atoolsm2
/
atooldef
< prev
next >
Wrap
Text File
|
1995-03-18
|
3KB
|
78 lines
DEFINITION MODULE AudioTools; (* BASED ON AUDIOTOOLS RELEASE.3.0 by Rob Peck *)
(* adapted to M2Amiga Modula-2 by Anthony Bryant *)
FROM SYSTEM IMPORT
ADDRESS, BYTE;
FROM Audio IMPORT
hardChannels;
FROM Exec IMPORT
Byte, IORequest, Message, MsgPortPtr;
CONST
maxChan = hardChannels;
audBuffers = 20; (* number of iob msg packets before need to allot *)
audClock = 3579545;
(* error return messages *)
badChannelSelected = -1; (* channel # out of range *)
notYourChannel = -2; (* not owned by your task *)
outOfMemory = -3; (* error return from AllocMem *)
TYPE
ExtIOB=RECORD
request: IORequest;
allocKey: INTEGER;
data: ADDRESS;
length: LONGCARD;
period: CARDINAL;
volume: CARDINAL;
cycles: CARDINAL;
writeMsg: Message; (* up to here, same as IOAudio *)
identifier: LONGINT; (* This field is added *)
END;
ExtIOBPtr=POINTER TO ExtIOB;
PROCEDURE InitAudio(): MsgPortPtr;
PROCEDURE CheckIfDone(): BOOLEAN;
PROCEDURE FinishAudio(uport: MsgPortPtr);
PROCEDURE GetChannel(channel: LONGINT): LONGINT;
PROCEDURE FreeChannel(channel: LONGINT): LONGINT;
PROCEDURE StopChannel(channel: LONGINT): LONGINT;
PROCEDURE StartChannel(channel: LONGINT): LONGINT;
PROCEDURE FlushChannel(channel: LONGINT): LONGINT;
PROCEDURE ResetChannel(channel: LONGINT): LONGINT;
PROCEDURE IsThatMyChan(channel: LONGINT): LONGINT;
PROCEDURE MayGetNote(uport: MsgPortPtr; flag: BOOLEAN): LONGINT;
PROCEDURE SetWave(channel: LONGINT;
VAR waveform: ARRAY OF BYTE): LONGINT;
PROCEDURE SetSamp(channel: LONGINT;
VAR sampleaudio: ADDRESS;
length: LONGINT): LONGINT;
PROCEDURE SetPV(channel: LONGINT;
period, volume: CARDINAL): LONGINT;
PROCEDURE PlayNote(channel: LONGINT;
note: CARDINAL; (* specific note number 0-95 *)
volume: CARDINAL; (* volume 0-64 *)
duration: CARDINAL; (* 1000ths of a second *)
priority: Byte; (* precedence value -128 to 127 *)
messageport: MsgPortPtr; (* for use by MayGetNote() *)
id: LONGINT);
PROCEDURE PlayFreq(channel: LONGINT;
freq: CARDINAL; (* specific frequency 28Hz to 7000Hz *)
volume: CARDINAL; (* volume 0-64 *)
duration: CARDINAL; (* 1000ths of a second *)
priority: Byte; (* precedence value -128 to 127 *)
messageport: MsgPortPtr; (* for use by MayGetNote() *)
id: LONGINT);
PROCEDURE PlaySamp(channel: LONGINT;
period: CARDINAL; (* specific period value 127 to 500 *)
volume: CARDINAL; (* volume 0-64 *)
duration: CARDINAL; (* 1000ths of a second *)
priority: Byte; (* precedence value -128 to 127 *)
messageport: MsgPortPtr; (* for use by MayGetNote() *)
id: LONGINT);
END AudioTools.def